import { KeyBinding } from "./keyBindings";

export const defaultKeys: KeyBinding[] = [
  // Instrument Code
  {
    key: "0",
    command: "editInstrumentField",
    args: 0,
    when: "instrumentColumnFocus",
  },
  {
    key: "1",
    command: "editInstrumentField",
    args: 1,
    when: "instrumentColumnFocus",
  },
  {
    key: "2",
    command: "editInstrumentField",
    args: 2,
    when: "instrumentColumnFocus",
  },
  {
    key: "3",
    command: "editInstrumentField",
    args: 3,
    when: "instrumentColumnFocus",
  },
  {
    key: "4",
    command: "editInstrumentField",
    args: 4,
    when: "instrumentColumnFocus",
  },
  {
    key: "5",
    command: "editInstrumentField",
    args: 5,
    when: "instrumentColumnFocus",
  },
  {
    key: "6",
    command: "editInstrumentField",
    args: 6,
    when: "instrumentColumnFocus",
  },
  {
    key: "7",
    command: "editInstrumentField",
    args: 7,
    when: "instrumentColumnFocus",
  },
  {
    key: "8",
    command: "editInstrumentField",
    args: 8,
    when: "instrumentColumnFocus",
  },
  {
    key: "9",
    command: "editInstrumentField",
    args: 9,
    when: "instrumentColumnFocus",
  },
  {
    key: "Delete",
    command: "editInstrumentField",
    args: null,
    when: "instrumentColumnFocus",
  },
  {
    key: "Backspace",
    command: "editInstrumentField",
    args: null,
    when: "instrumentColumnFocus",
  },

  // Effect Code
  {
    key: "0",
    command: "editEffectCodeField",
    args: 0,
    when: "effectCodeColumnFocus",
  },
  {
    key: "1",
    command: "editEffectCodeField",
    args: 1,
    when: "effectCodeColumnFocus",
  },
  {
    key: "2",
    command: "editEffectCodeField",
    args: 2,
    when: "effectCodeColumnFocus",
  },
  {
    key: "3",
    command: "editEffectCodeField",
    args: 3,
    when: "effectCodeColumnFocus",
  },
  {
    key: "4",
    command: "editEffectCodeField",
    args: 4,
    when: "effectCodeColumnFocus",
  },
  {
    key: "5",
    command: "editEffectCodeField",
    args: 5,
    when: "effectCodeColumnFocus",
  },
  {
    key: "6",
    command: "editEffectCodeField",
    args: 6,
    when: "effectCodeColumnFocus",
  },
  {
    key: "7",
    command: "editEffectCodeField",
    args: 7,
    when: "effectCodeColumnFocus",
  },
  {
    key: "8",
    command: "editEffectCodeField",
    args: 8,
    when: "effectCodeColumnFocus",
  },
  {
    key: "9",
    command: "editEffectCodeField",
    args: 9,
    when: "effectCodeColumnFocus",
  },
  {
    key: "a",
    command: "editEffectCodeField",
    args: 10,
    when: "effectCodeColumnFocus",
  },
  {
    key: "b",
    command: "editEffectCodeField",
    args: 11,
    when: "effectCodeColumnFocus",
  },
  {
    key: "c",
    command: "editEffectCodeField",
    args: 12,
    when: "effectCodeColumnFocus",
  },
  {
    key: "d",
    command: "editEffectCodeField",
    args: 13,
    when: "effectCodeColumnFocus",
  },
  {
    key: "e",
    command: "editEffectCodeField",
    args: 14,
    when: "effectCodeColumnFocus",
  },
  {
    key: "f",
    command: "editEffectCodeField",
    args: 15,
    when: "effectCodeColumnFocus",
  },
  {
    key: "Delete",
    command: "editEffectCodeField",
    args: null,
    when: "effectCodeColumnFocus",
  },
  {
    key: "Backspace",
    command: "editEffectCodeField",
    args: null,
    when: "effectCodeColumnFocus",
  },
  // Subpattern Offset
  {
    key: "-",
    command: "editOffsetField",
    args: "-",
    when: "offsetColumnFocus",
  },
  {
    key: "+",
    command: "editOffsetField",
    args: "+",
    when: "offsetColumnFocus",
  },
  {
    key: "0",
    command: "editOffsetField",
    args: 0,
    when: "offsetColumnFocus",
  },
  {
    key: "1",
    command: "editOffsetField",
    args: 1,
    when: "offsetColumnFocus",
  },
  {
    key: "2",
    command: "editOffsetField",
    args: 2,
    when: "offsetColumnFocus",
  },
  {
    key: "3",
    command: "editOffsetField",
    args: 3,
    when: "offsetColumnFocus",
  },
  {
    key: "4",
    command: "editOffsetField",
    args: 4,
    when: "offsetColumnFocus",
  },
  {
    key: "5",
    command: "editOffsetField",
    args: 5,
    when: "offsetColumnFocus",
  },
  {
    key: "6",
    command: "editOffsetField",
    args: 6,
    when: "offsetColumnFocus",
  },
  {
    key: "7",
    command: "editOffsetField",
    args: 7,
    when: "offsetColumnFocus",
  },
  {
    key: "8",
    command: "editOffsetField",
    args: 8,
    when: "offsetColumnFocus",
  },
  {
    key: "9",
    command: "editOffsetField",
    args: 9,
    when: "offsetColumnFocus",
  },
  {
    key: "Delete",
    command: "editOffsetField",
    args: null,
    when: "offsetColumnFocus",
  },
  {
    key: "Backspace",
    command: "editOffsetField",
    args: null,
    when: "offsetColumnFocus",
  },
  // Subpattern Jump
  {
    key: "0",
    command: "editJumpField",
    args: 0,
    when: "jumpColumnFocus",
  },
  {
    key: "1",
    command: "editJumpField",
    args: 1,
    when: "jumpColumnFocus",
  },
  {
    key: "2",
    command: "editJumpField",
    args: 2,
    when: "jumpColumnFocus",
  },
  {
    key: "3",
    command: "editJumpField",
    args: 3,
    when: "jumpColumnFocus",
  },
  {
    key: "4",
    command: "editJumpField",
    args: 4,
    when: "jumpColumnFocus",
  },
  {
    key: "5",
    command: "editJumpField",
    args: 5,
    when: "jumpColumnFocus",
  },
  {
    key: "6",
    command: "editJumpField",
    args: 6,
    when: "jumpColumnFocus",
  },
  {
    key: "7",
    command: "editJumpField",
    args: 7,
    when: "jumpColumnFocus",
  },
  {
    key: "8",
    command: "editJumpField",
    args: 8,
    when: "jumpColumnFocus",
  },
  {
    key: "9",
    command: "editJumpField",
    args: 9,
    when: "jumpColumnFocus",
  },
  {
    key: "Delete",
    command: "editJumpField",
    args: null,
    when: "jumpColumnFocus",
  },
  {
    key: "Backspace",
    command: "editJumpField",
    args: null,
    when: "jumpColumnFocus",
  },
  // Effect Param
  {
    key: "0",
    command: "editEffectParamField",
    args: 0,
    when: "effectParamColumnFocus",
  },
  {
    key: "1",
    command: "editEffectParamField",
    args: 1,
    when: "effectParamColumnFocus",
  },
  {
    key: "2",
    command: "editEffectParamField",
    args: 2,
    when: "effectParamColumnFocus",
  },
  {
    key: "3",
    command: "editEffectParamField",
    args: 3,
    when: "effectParamColumnFocus",
  },
  {
    key: "4",
    command: "editEffectParamField",
    args: 4,
    when: "effectParamColumnFocus",
  },
  {
    key: "5",
    command: "editEffectParamField",
    args: 5,
    when: "effectParamColumnFocus",
  },
  {
    key: "6",
    command: "editEffectParamField",
    args: 6,
    when: "effectParamColumnFocus",
  },
  {
    key: "7",
    command: "editEffectParamField",
    args: 7,
    when: "effectParamColumnFocus",
  },
  {
    key: "8",
    command: "editEffectParamField",
    args: 8,
    when: "effectParamColumnFocus",
  },
  {
    key: "9",
    command: "editEffectParamField",
    args: 9,
    when: "effectParamColumnFocus",
  },
  {
    key: "a",
    command: "editEffectParamField",
    args: 10,
    when: "effectParamColumnFocus",
  },
  {
    key: "b",
    command: "editEffectParamField",
    args: 11,
    when: "effectParamColumnFocus",
  },
  {
    key: "c",
    command: "editEffectParamField",
    args: 12,
    when: "effectParamColumnFocus",
  },
  {
    key: "d",
    command: "editEffectParamField",
    args: 13,
    when: "effectParamColumnFocus",
  },
  {
    key: "e",
    command: "editEffectParamField",
    args: 14,
    when: "effectParamColumnFocus",
  },
  {
    key: "f",
    command: "editEffectParamField",
    args: 15,
    when: "effectParamColumnFocus",
  },
  {
    key: "Delete",
    command: "editEffectParamField",
    args: null,
    when: "effectParamColumnFocus",
  },
  {
    key: "Backspace",
    command: "editEffectParamField",
    args: null,
    when: "effectParamColumnFocus",
  },
];

export const openMPTKeys: KeyBinding[] = [
  {
    key: "q",
    command: "editNoteField",
    args: 0,
    when: "noteColumnFocus",
  },
  {
    key: "w",
    command: "editNoteField",
    args: 1,
    when: "noteColumnFocus",
  },
  {
    key: "e",
    command: "editNoteField",
    args: 2,
    when: "noteColumnFocus",
  },
  {
    key: "r",
    command: "editNoteField",
    args: 3,
    when: "noteColumnFocus",
  },
  {
    key: "t",
    command: "editNoteField",
    args: 4,
    when: "noteColumnFocus",
  },
  {
    key: "y",
    command: "editNoteField",
    args: 5,
    when: "noteColumnFocus",
  },
  {
    key: "u",
    command: "editNoteField",
    args: 6,
    when: "noteColumnFocus",
  },
  {
    key: "i",
    command: "editNoteField",
    args: 7,
    when: "noteColumnFocus",
  },
  {
    key: "o",
    command: "editNoteField",
    args: 8,
    when: "noteColumnFocus",
  },
  {
    key: "p",
    command: "editNoteField",
    args: 9,
    when: "noteColumnFocus",
  },
  {
    key: "[",
    command: "editNoteField",
    args: 10,
    when: "noteColumnFocus",
  },
  {
    key: "]",
    command: "editNoteField",
    args: 11,
    when: "noteColumnFocus",
  },
  {
    key: "a",
    command: "editNoteField",
    args: 12,
    when: "noteColumnFocus",
  },
  {
    key: "s",
    command: "editNoteField",
    args: 13,
    when: "noteColumnFocus",
  },
  {
    key: "d",
    command: "editNoteField",
    args: 14,
    when: "noteColumnFocus",
  },
  {
    key: "f",
    command: "editNoteField",
    args: 15,
    when: "noteColumnFocus",
  },
  {
    key: "g",
    command: "editNoteField",
    args: 16,
    when: "noteColumnFocus",
  },
  {
    key: "h",
    command: "editNoteField",
    args: 17,
    when: "noteColumnFocus",
  },
  {
    key: "j",
    command: "editNoteField",
    args: 18,
    when: "noteColumnFocus",
  },
  {
    key: "k",
    command: "editNoteField",
    args: 19,
    when: "noteColumnFocus",
  },
  {
    key: "l",
    command: "editNoteField",
    args: 20,
    when: "noteColumnFocus",
  },
  {
    key: ";",
    command: "editNoteField",
    args: 21,
    when: "noteColumnFocus",
  },
  {
    key: "'",
    command: "editNoteField",
    args: 22,
    when: "noteColumnFocus",
  },
  {
    key: "\\",
    command: "editNoteField",
    args: 23,
    when: "noteColumnFocus",
  },
  {
    key: "z",
    command: "editNoteField",
    args: 24,
    when: "noteColumnFocus",
  },
  {
    key: "x",
    command: "editNoteField",
    args: 25,
    when: "noteColumnFocus",
  },
  {
    key: "c",
    command: "editNoteField",
    args: 26,
    when: "noteColumnFocus",
  },
  {
    key: "v",
    command: "editNoteField",
    args: 27,
    when: "noteColumnFocus",
  },
  {
    key: "b",
    command: "editNoteField",
    args: 28,
    when: "noteColumnFocus",
  },
  {
    key: "n",
    command: "editNoteField",
    args: 29,
    when: "noteColumnFocus",
  },
  {
    key: "m",
    command: "editNoteField",
    args: 30,
    when: "noteColumnFocus",
  },
  {
    key: ",",
    command: "editNoteField",
    args: 31,
    when: "noteColumnFocus",
  },
  {
    key: ".",
    command: "editNoteField",
    args: 32,
    when: "noteColumnFocus",
  },
  {
    key: "/",
    command: "editNoteField",
    args: 33,
    when: "noteColumnFocus",
  },
  //if (e.code == "??") editNoteCell(34);
  //if (e.code == "??") editNoteCell(35);
  {
    key: "Delete",
    command: "editNoteField",
    args: null,
    when: "noteColumnFocus",
  },
  {
    key: "Backspace",
    command: "editNoteField",
    args: null,
    when: "noteColumnFocus",
  },
];

export const milkytrackerKeys: KeyBinding[] = [
  {
    key: "q",
    command: "editNoteField",
    args: 12,
    when: "noteColumnFocus",
  },
  {
    key: "2",
    command: "editNoteField",
    args: 13,
    when: "noteColumnFocus",
  },
  {
    key: "w",
    command: "editNoteField",
    args: 14,
    when: "noteColumnFocus",
  },
  {
    key: "3",
    command: "editNoteField",
    args: 15,
    when: "noteColumnFocus",
  },
  {
    key: "e",
    command: "editNoteField",
    args: 16,
    when: "noteColumnFocus",
  },
  {
    key: "r",
    command: "editNoteField",
    args: 17,
    when: "noteColumnFocus",
  },
  {
    key: "5",
    command: "editNoteField",
    args: 18,
    when: "noteColumnFocus",
  },
  {
    key: "t",
    command: "editNoteField",
    args: 19,
    when: "noteColumnFocus",
  },
  {
    key: "6",
    command: "editNoteField",
    args: 20,
    when: "noteColumnFocus",
  },
  {
    key: "y",
    command: "editNoteField",
    args: 21,
    when: "noteColumnFocus",
  },
  {
    key: "7",
    command: "editNoteField",
    args: 22,
    when: "noteColumnFocus",
  },
  {
    key: "u",
    command: "editNoteField",
    args: 23,
    when: "noteColumnFocus",
  },
  {
    key: "i",
    command: "editNoteField",
    args: 24,
    when: "noteColumnFocus",
  },
  {
    key: "9",
    command: "editNoteField",
    args: 25,
    when: "noteColumnFocus",
  },
  {
    key: "o",
    command: "editNoteField",
    args: 26,
    when: "noteColumnFocus",
  },
  {
    key: "0",
    command: "editNoteField",
    args: 27,
    when: "noteColumnFocus",
  },
  {
    key: "p",
    command: "editNoteField",
    args: 28,
    when: "noteColumnFocus",
  },
  {
    key: "[",
    command: "editNoteField",
    args: 29,
    when: "noteColumnFocus",
  },
  {
    key: "=",
    command: "editNoteField",
    args: 30,
    when: "noteColumnFocus",
  },
  {
    key: "]",
    command: "editNoteField",
    args: 31,
    when: "noteColumnFocus",
  },
  {
    key: "z",
    command: "editNoteField",
    args: 0,
    when: "noteColumnFocus",
  },
  {
    key: "s",
    command: "editNoteField",
    args: 1,
    when: "noteColumnFocus",
  },
  {
    key: "x",
    command: "editNoteField",
    args: 2,
    when: "noteColumnFocus",
  },
  {
    key: "d",
    command: "editNoteField",
    args: 3,
    when: "noteColumnFocus",
  },
  {
    key: "c",
    command: "editNoteField",
    args: 4,
    when: "noteColumnFocus",
  },
  {
    key: "v",
    command: "editNoteField",
    args: 5,
    when: "noteColumnFocus",
  },
  {
    key: "g",
    command: "editNoteField",
    args: 6,
    when: "noteColumnFocus",
  },
  {
    key: "b",
    command: "editNoteField",
    args: 7,
    when: "noteColumnFocus",
  },
  {
    key: "h",
    command: "editNoteField",
    args: 8,
    when: "noteColumnFocus",
  },
  {
    key: "n",
    command: "editNoteField",
    args: 9,
    when: "noteColumnFocus",
  },
  {
    key: "j",
    command: "editNoteField",
    args: 10,
    when: "noteColumnFocus",
  },
  {
    key: "m",
    command: "editNoteField",
    args: 11,
    when: "noteColumnFocus",
  },
  {
    key: ",",
    command: "editNoteField",
    args: 12,
    when: "noteColumnFocus",
  },
  {
    key: "l",
    command: "editNoteField",
    args: 13,
    when: "noteColumnFocus",
  },
  {
    key: ".",
    command: "editNoteField",
    args: 14,
    when: "noteColumnFocus",
  },
  {
    key: ";",
    command: "editNoteField",
    args: 15,
    when: "noteColumnFocus",
  },
  {
    key: "/",
    command: "editNoteField",
    args: 16,
    when: "noteColumnFocus",
  },
  {
    key: "Delete",
    command: "editNoteField",
    args: null,
    when: "noteColumnFocus",
  },
  {
    key: "Backspace",
    command: "editNoteField",
    args: null,
    when: "noteColumnFocus",
  },
];
